var login_panel = new Ext.form.FormPanel( {
	xtype: 'form',
	id : 'loginForm',
	method : 'POST',
	standardSubmit : true,
	scroll: 'vertical',
	items : [ {
		xtype : 'fieldset',
		title : '메일 로그인',
		//instructions : 'instructions은 아래에 나타나는 내용~',
		defaults : {
			// labelAlign: 'right'
			labelWidth : '15%',
			style : {
				border : "1px solid #ff0000"
			}
		},
		items : [ {
			xtype : 'textfield',
			name : 'id',
			label : 'id',
			placeHolder : 'id 입력',
			autoCapitalize : true,
			required : true,
			useClearIcon : true
		}, {
			xtype : 'passwordfield',
			name : 'password',
			label : 'password',
			placeHolder : 'password',
			autoCapitalize : true,
			required : true,
			useClearIcon : true
		}, {
			xtype:'button',
			width: '15%',
			text: 'Login',
			iconCls:'round',
			iconAlign: 'top',
			handler:function(){
				dologin();
			},
		} ]
	} ]
})

var dologin = function()
{
	login_panel.setLoading(true, false);
	Ext.Ajax.request({
    	url: '../readJsonGMail.do',
        method: 'get',
        params: {id: login_panel.getValues().id, 
        	pass : login_panel.getValues().password },
        success: function(response, opts) {
        	//data = Ext.decode(response.responseText);
        	login_panel.setLoading(false);
            Ext.Msg.alert('Login Success');
            mailStore.sort('receivedDate', 'DESC');
            //mailStore.load();
            login_panel.reset();
        }
    });
}